/**
 * @desc: 工单管理
 * @author xiongyi
 * @date 2022/12/06
*/
import request from '@/assets/common/js/utils/request'

/**
 * @description 获取工单列表
 * @param Object: {data} 接口请求参数
 * @return
 * @author qiankui 2023-3-7 15:25:45
 **/
export function pagesearchworkorders(data) {
    return request({
        url: "/workorder/pagesearchworkorders",
        method: "post",
        data: data,
        formdataType: false
    })
}
/**
 * @description 创建
 * @param Object: {data} 接口请求参数
 * @return
 * @author qiankui 2023-3-7 20:22:08
 **/
export function createworkorder(data) {
    var  form = new FormData();
    form.append("workOrderJson",data.workOrderJson)
    if(data.attachments){
        for(var i=0;i<data.attachments.length;i++){
            form.append("attachments",data.attachments[i])
        }
    }
    return request({
        url: "/workorder/createworkorder",
        method: "post",
        data: form,
        formdataType: false
    })
}
